package com.ybxx.dashboard.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.ybxx.base.model.ReadPerson;
import com.ybxx.core.model.BaseModel;
@Entity
@Table(name="tbl_dashboard_watermeter")
public class Watermeter extends BaseModel {
	@Id
	private String wmcode;
	@ManyToOne(targetEntity=Spread.class,fetch=FetchType.LAZY)
	@JoinColumn(name="sid",referencedColumnName="sid") 
	private Spread spread;
	@ManyToOne(targetEntity=ReadPerson.class,fetch=FetchType.LAZY)
	@JoinColumn(name="pid",referencedColumnName="pid") 
	private ReadPerson readPerson;
	private String snum;
	private String size;
	private String position;
	private String cycle;
	private String record;
	private String start;
	@OneToMany(targetEntity=WatermeterRoom.class,cascade={CascadeType.ALL},mappedBy="watermeter",fetch = FetchType.LAZY)
	private Set<WatermeterRoom> watermeterRooms=new HashSet<WatermeterRoom>();
	public String getWmcode() {
		return wmcode;
	}
	public void setWmcode(String wmcode) {
		this.wmcode = wmcode;
	}
	public Spread getSpread() {
		return spread;
	}
	public void setSpread(Spread spread) {
		this.spread = spread;
	}
	public ReadPerson getReadPerson() {
		return readPerson;
	}
	public void setReadPerson(ReadPerson readPerson) {
		this.readPerson = readPerson;
	}
	public String getSnum() {
		return snum;
	}
	public void setSnum(String snum) {
		this.snum = snum;
	}
	public String getSize() {
		return size;
	}
	public void setSize(String size) {
		this.size = size;
	}
	public String getPosition() {
		return position;
	}
	public void setPosition(String position) {
		this.position = position;
	}
	public String getCycle() {
		return cycle;
	}
	public void setCycle(String cycle) {
		this.cycle = cycle;
	}
	public String getRecord() {
		return record;
	}
	public void setRecord(String record) {
		this.record = record;
	}
	public String getStart() {
		return start;
	}
	public void setStart(String start) {
		this.start = start;
	}
	public Set<WatermeterRoom> getWatermeterRooms() {
		return watermeterRooms;
	}
	public void setWatermeterRooms(Set<WatermeterRoom> watermeterRooms) {
		this.watermeterRooms = watermeterRooms;
	}
	
	
	
}
